<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorator="blog/layout" th:with="title='分类 |',active='category'">
<header th:replace="blog/layout::headerFragment(${title},${active})"></header>
<body>
<div layout:fragment="content">
    <div class="content-wrap">
        <div id="content" class="content">
            <div id="posts" class="posts-expand">
                <div class="category-all-page">
                    <header class="post-header" style="opacity: 1; display: block; transform: translateY(0px);">
                        <h1 class="post-title" itemprop="name headline">所有分类</h1>
                    </header>
                    <div class="category-all-title">
                        目前共计 <th:block th:text="${categoryCount}"></th:block> 个分类
                    </div>
                    <th:block th:if="${categories}">
                        <div th:each="category : ${categories}" class="category-all">
                            <ul class="category-list">
                                <li class="category-list-item">
                                    <th:block th:if="${category.count != 0}">
                                        <a class="category-list-link" th:href="@{'/categories/'+${category.name}}">
                                            <th:block th:text="${category.name}"></th:block>
                                        </a>
                                    </th:block>
                                    <th:block th:unless="${category.count != 0}">
                                        <a class="category-list-link">
                                            <th:block th:text="${category.name}"></th:block>
                                        </a>
                                    </th:block>

                                    <span class="category-list-count" th:text="${category.count}"></span>
                                </li>
                            </ul>
                        </div>
                    </th:block>

                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>